package com.mnsq.common.bean.enums;

/**
 * 状态枚举总汇
 * 通用状态、订单状态等等
 *
 * @author 周俭
 */
public enum StatusEnum {
    /* common status */
    STATUS_ERROR(-1, "失败"),
    STATUS_VALID(1, "有效"),
    STATUS_INVALID(2, "异常"),
    STATUS_DEL(3, "已删除"),
    STATUS_HIDDEN(4, "隐藏"),

    SUBJECT_WAITING(1, "待审核"),
    SUBJECT_ERROR(2, "异常"),
    SUBJECT_DELETE(3, "已删除"),
    SUBJECT_HIDE(4, "隐藏"),
    SUBJECT_AGREE(5, "已审核"),
    SUBJECT_DISAGREE(6, "已拒绝"),

    /* whether read */
    READ_NOT(0, "未读"),
    READ_HAVE(1, "已读"),

    /* whether check */
    CHECK_NOT(0, "未验证"),
    CHECK_DOING(1, "验证中"),
    CHECK_SUCCESS(2, "已验证"),
    CHECK_FAILED(3, "验证失败"),

    WT_YES(0, "否"),
    WT_NO(1, "是"),

    /* order status 1:待付款   2：待发货  3：已发货（待收货）  4：已收货（待结算）  5：对账中（已结算）  6：已完成  7：退货中  8：已取消  9:待确认付款*/
    ORDER_CONFIRM(1, "待付款"),
    ORDER_PAYED(2, "待发货"),
    ORDER_WAIT_FOR_RECEIVE(3, "待确认收货（已发货）"),
    ORDER_RECEIVED(4, "已收货（待结算）"),
    ORDER_BALANCE(5, "对账中（已结算）"),
    ORDER_COMPLETE(6, "已完成"),
    ORDER_RETURN_OF_GOODS(7, "退货中"),
    ORDER_CANCELED(8, "已取消"),
    ORDER_WAIT_FOR_PAY_CONFIRM(9, "待确认付款");
    public Integer value;
    public String description;

    StatusEnum(Integer value, String description) {
        this.value = value;
        this.description = description;
    }

    public String getDescription(Integer value) {
        for (StatusEnum se : StatusEnum.values()) {
            if (se.value.equals(value)) {
                return se.description;
            }
        }
        return null;
    }
}
